/**
 * Route Mappings
 * (sails.config.routes)
 *
 * Your routes map URLs to views and controllers.
 *
 * If Sails receives a URL that doesn't match any of the routes below,
 * it will check for matching files (images, scripts, stylesheets, etc.)
 * in your assets directory.  e.g. `http://localhost:1337/images/foo.jpg`
 * might match an image file: `/assets/images/foo.jpg`
 *
 * Finally, if those don't match either, the default 404 handler is triggered.
 * See `api/responses/notFound.js` to adjust your app's 404 logic.
 *
 * Note: Sails doesn't ACTUALLY serve stuff from `assets`-- the default Gruntfile in Sails copies
 * flat files from `assets` to `.tmp/public`.  This allows you to do things like compile LESS or
 * CoffeeScript for the front-end.
 *
 * For more information on configuring custom routes, check out:
 * http://sailsjs.org/#!/documentation/concepts/Routes/RouteTargetSyntax.html
 */

module.exports.routes = {

  /***************************************************************************
  *                                                                          *
  * Make the view located at `views/homepage.ejs` (or `views/homepage.jade`, *
  * etc. depending on your default view engine) your home page.              *
  *                                                                          *
  * (Alternatively, remove this and add an `index.html` file in your         *
  * `assets` directory)                                                      *
  *                                                                          *
  ***************************************************************************/

  '/': 'HomeController.index',

  '/product': 'ProductController.index',

  '/about-us': 'HomeController.about',

  '/contact-us': 'HomeController.contact',

  '/faq': 'HomeController.faq',

  '/pdf': 'DownloadController.index',

  '/equipment': 'HomeController.other',

  'get /bar': {view: 'barcode'},

  'get /product/:id': 'ProductController.detail',

  'get /admin/login': {view: 'admin/login', locals: {layout: 'admin/layout_login'}},

  'post /admin/login': 'LoginController.login',

  'get /admin/logout': 'LoginController.logout',

  'get /admin': 'AdminController.index',

  'get /admin/slider': 'SliderController.index',

  'post /admin/slider/createSlider': 'SliderController.createSlider',

  'get /admin/slider/deleteSlider/:id': 'SliderController.deleteSlider',

  'get /admin/product/cat': 'ProductController.category',

  'post /admin/product/cat': 'ProductController.addCat',

  'get /admin/product/cat/delete/:id': 'ProductController.deleteCat',

  'get /admin/product/list/:id': 'ProductController.all',

  'get /admin/product/add': {view: 'admin/addProduct', locals: {layout: 'admin/layout'}},

  'post /admin/product/add': 'ProductController.addProduct',

  'get /admin/product/getCat': 'ProductController.getCat',

  'get /admin/product/delete/:id': 'ProductController.deleteProduct',

  'get /admin/faq': 'AdminController.faq',

  'post /admin/faq/add': 'AdminController.addFaq',

  'get /admin/faq/delete/:id': 'AdminController.deleteFaq',

  'get /admin/pdf': 'AdminController.pdf',

  'post /admin/pdf/add': 'AdminController.pdfAdd',

  //'get /admin/product/list/:id': 'ProductController.catProduct',

  /***************************************************************************
  *                                                                          *
  * Custom routes here...                                                    *
  *                                                                          *
  * If a request to a URL doesn't match any of the custom routes above, it   *
  * is matched against Sails route blueprints. See `config/blueprints.js`    *
  * for configuration options and examples.                                  *
  *                                                                          *
  ***************************************************************************/

};
